﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;

namespace ctolua.Models
{
    /// <summary>
    /// 形状
    /// </summary>
    public class MShape
    {
        /// <summary>
        /// 形状对象
        /// </summary>
        public Shape shape { get; set; }
        public MShape(Shape shape)
        {
            this.shape = shape;

        }
        /// <summary>
        /// 创建一个圆形
        /// </summary>
        /// <param name="radius"> 半径 </param>
        /// <returns>圆形对象</returns>
        public static MShape create_circular_shape(double? radius)
        {
            return new MShape(global_api.create_circular_shape(py.Fix32(radius)));
        }
        /// <summary>
        /// 创建一个矩形
        /// </summary>
        /// <param name="width"> 长 </param>
        /// <param name="length"> 宽 </param>
        /// <param name="yaw"> 朝向 </param>
        /// <param name="offset_x_ratio"> 偏移x </param>
        /// <param name="offset_y_ratio"> 偏移y </param>
        /// <returns>矩形对象</returns>
        public static MShape create_rectangle_shape(double width, double length, double yaw, double offset_x_ratio, double offset_y_ratio)
        {
            return new MShape(global_api.create_rectangle_shape(py.Fix32(width), py.Fix32(length), yaw, py.Fix32(offset_x_ratio), py.Fix32(offset_y_ratio)));
        }
        /// <summary>
        /// 创建一个环形
        /// </summary>
        /// <param name="small_r"> 小圆半径 </param>
        /// <param name="big_r"> 大圆半径 </param>
        /// <returns>环形对象</returns>
        public static MShape create_annular_shape(double small_r, double big_r)
        {
            return new MShape(global_api.create_annular_shape(py.Fix32(small_r), py.Fix32(big_r)));
        }
        /// <summary>
        /// 创建一个扇形
        /// </summary>
        /// <param name="radius"> 半径 </param>
        /// <param name="angle"> 角度 </param>
        /// <param name="yaw"> 朝向 </param>
        /// <returns>扇形对象</returns>
        public static MShape create_sector_shape(double radius, double angle, double? yaw)
        {
            return new MShape(global_api.create_sector_shape( py.Fix32(radius),  py.Fix32(angle), yaw));
        }

        

    }
}
